// Copyright (c) 2009 http://grommet.codeplex.com
// This source is subject to the Microsoft Public License.
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.

using System;
using Microsoft.SPOT;
using System.IO;
using System.Ext;

namespace System.Net
{
    public abstract class WebRequest
    {
        public virtual string Method
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }

        public virtual WebHeaderCollection Headers
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }
        
        public virtual string ContentType
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }

        public virtual long ContentLength
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }

        public virtual int Timeout
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }

        public virtual Uri RequestUri
        {
            get { throw new NotImplementedException(); }
            protected set { throw new NotImplementedException(); }
        }


        public static WebRequest Create(string requestUriString)
        {
            if (requestUriString == null)
            {
                throw new ArgumentNullException("requestUriString");
            }

            return Create(new Uri(requestUriString));
        }

        public static WebRequest Create(Uri requestUri)
        {
            if (requestUri == null)
            {
                throw new ArgumentNullException("requestUri");
            }

            if (requestUri.Scheme.ToLower() == "http")
            {
                return new HttpWebRequest(requestUri);
            }

            throw new NotSupportedException("The request scheme specified in requestUri is not registered.");
        }

        public virtual WebResponse GetResponse()
        {
            throw new NotImplementedException();
        }

        public virtual Stream GetRequestStream()
        {
            throw new NotImplementedException();
        }
    }
}
